import { mapGetters } from 'vuex'
export default {
  computed: {
    ...mapGetters('car', ['totalCount'])
  },
  onShow() {
    uni.setTabBarBadge({
      index: 1,
      text: this.totalCount.toString()
    })
  },
  watch: {
    totalCount: {
      handler(newValue) {
        uni.setTabBarBadge({
          index: 1,
          text: newValue.toString(),
          fail() {}
        })
      },
      immediate: true
    }
  },
}